package com.tm.util;

import java.util.Random;

/**
 * 2024/5/17 Cjj CodeUtil  9:32
 */
public class CodeUtil {
    private CodeUtil(){

    }
    public static String createCode(int n){
         String code="";
         String data="abcdefghijklmnopqrstuVWXyZABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";

        Random r = new Random();
        for (int i = 0; i <n; i++) {
            int index = r.nextInt(data.length());
              code+=data.charAt(index);
        }
        return  code;
    }
}
